Skip to content

Sanchaga/pr 38 reviewbottest - #39

Open
sanchaga-splunk wants to merge 2 commits into
mainfrom
sanchaga/pr-38-reviewbottest
Open

Sanchaga/pr 38 reviewbottest#39
sanchaga-splunk wants to merge 2 commits into
mainfrom
sanchaga/pr-38-reviewbottest

Conversation

@sanchaga-splunk

Copy link
Copy Markdown

Features

List any features you're adding to this app (e.g. new actions, parameters, auth methods, etc.)

  • THIS IS A TEST FOR REVIEW BOT

Bug Fixes

Describe any bugs you've fixed in this app, and how they were fixed

Manual Documentation

Have you made any changes that should be documented in manual_readme_content.md?

The following changes require documentation in manual_readme_content.md:

  • New, updated, or removed REST handlers
  • New, updated, or removed authentication methods, especially complex methods like OAuth
  • Compatibility considerations with respect to deployment types (e.g. actions that cannot be run on cloud or an automation broker)
  • I have verified that manual documentation has been updated where appropriate

Other information


Please refer to our Contribution Guide for any questions on submitting a pull request.

Thanks for contributing!

@sanchaga-splunk sanchaga-splunk left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agentic PR review inline comments.

Comment thread src/actions/make_req.py


@app.make_request()
def make_request(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: make_request action registered without read_only=False despite supporting mutating HTTP methods The decorator @app.make_request() is called with no arguments. SDK App.action() defaults to read_only=True. The action explicitly supports POST, PATCH, PUT, and DELETE via params.http_method, which are mutating operations.

Code reference: @app.make_request() decorator

Current line: def make_request(

Impact: SOAR marks the action as read-only in the generated manifest, preventing it from being used in write-enabled playbook contexts and misrepresenting its capability to users.

How to fix: Change the decorator to @app.make_request(read_only=False) so the generated metadata correctly reflects that this action can perform mutating API calls.

Suggested change
def make_request(
@app.make_request(read_only=False)

Comment thread src/client.py
"""Return the correct httpx.Auth object for the configured asset credentials.

Priority order:
1. personal_access_token (PAT) → Authorization: Bearer

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: resolve_auth only supports personal_access_token, silently breaking username/password and OAuth client credentials src/client.py lines 54-60: only checks asset.personal_access_token; raises ActionFailure otherwise. The Asset model retains client_id, client_secret, username, and password fields. The legacy connector supported all three auth paths.

Code reference: resolve_auth function

Current line: 1. personal_access_token (PAT) → Authorization: Bearer

Impact: Existing SOAR assets configured with username/password or OAuth client credentials will fail immediately after upgrade with a misleading error. This is a silent backward-compatibility regression for any deployed non-PAT asset.

How to fix: Either add username/password (Basic auth) and client_id/client_secret (token-exchange or Basic auth) branches to resolve_auth matching the legacy connector's priority order, or explicitly document in release notes that only PAT is now supported and remove the unused credential fields from the Asset model.

Comment thread src/actions/get_issue.py
@app.action(
description="Retrieve an issue for the GitHub repository", action_type="investigate"
)
def get_issue(params: GetIssueParams, soar: SOARClient, asset: Asset) -> GetIssueOutput:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Required non-optional fields in output models will fail Pydantic validation on sparse GitHub API responses Fields such as milestone, closed_by, assignee on GetIssueOutput and MilestoneOutput.creator: CreatorOutput are typed as required non-Optional. The GitHub Issues API documents these as nullable. A strict Pydantic model_validate() call on a real response where these are null (e.g. open issue with no milestone, issue created by deleted account) will raise ValidationError and fail the action.

Code reference: GetIssueOutput, MilestoneOutput, ClosedByOutput, AssigneeOutput, CreatorOutput

Current line: def get_issue(params: GetIssueParams, soar: SOARClient, asset: Asset) -> GetIssueOutput:

Impact: Any playbook calling get issue, create issue, update issue, or list issues on an open or unassigned issue will get a runtime validation failure instead of action data, breaking existing playbooks silently after the SDK migration.

How to fix: Annotate nullable nested objects as Optional: milestone: MilestoneOutput | None = None, closed_by: ClosedByOutput | None = None, assignee: AssigneeOutput | None = None, creator: CreatorOutput | None = None. Also audit URL template fields on user sub-models (e.g. avatar_url, events_url, followers_url, login, site_admin) and add | None where the GitHub API can return null.

)
return RemoveMemberOutput(status="success")

soar.set_message(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: remove_member returns status='success' when user is not a team member After exhausting both the active-members list and the pending-invitations list without finding the user, the function calls soar.set_message(GITHUB_USER_NOT_TEAM_MEMBER_MSG...) and then returns RemoveMemberOutput(status='success'). No removal occurred, but the action reports success.

Code reference: remove_member function, final return statement

Current line: soar.set_message(

Impact: A playbook checking action_result.status == 'success' will incorrectly conclude the user was removed. The correct behavior for a no-op non-removal is to fail the action so the playbook can branch appropriately.

How to fix: Raise an exception or use the SDK's failure mechanism instead of returning RemoveMemberOutput(status='success') when the user is not found in either the active-members or pending-invitations list.

description="List comments for an issue on the GitHub repository",
action_type="investigate",
)
def list_comments(

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: ListCommentsSummary is defined but not passed to @app.action(), so it will not appear in generated metadata ListCommentsSummary is defined and soar.set_summary(ListCommentsSummary(...)) is called at runtime, but the @app.action() decorator at line 148 has no summary_cls= argument. The same pattern is present for list_users (ListUsersSummary) and list_issues (ListIssuesSummary).

Code reference: list_comments @app.action() decorator; ListCommentsSummary class

Current line: def list_comments(

Impact: Without the summary class wired into the action decorator, the generated app JSON omits the summary output path (e.g. action_result.summary.total_comments).

How to fix: Add summary_cls=ListCommentsSummary to the @app.action() decorator for list_comments, and apply the same fix to list_users and list_issues.

Suggested change
def list_comments(
@app.action(
description="List comments for an issue on the GitHub repository",
action_type="investigate",
summary_cls=ListCommentsSummary,
)

Copy link
Copy Markdown
Author

Issue: make request action has no test coverage, blocking the test-coverage CI check CI test-coverage job log (job 83370738506, 2026-06-25T06:37:47): 'Only 94% of actions have tests. These actions appear to be missing tests: - make request'. The job exits non-zero, blocking merge.

Location: tests/test_actions.py

Code reference: make_request / make_req action identifier

Impact: The test-coverage gate enforces 100% action test coverage. The make request action is a generic HTTP proxy action that can execute arbitrary API calls; missing test coverage means auth handling, parameter validation, and error paths are unverified before merge.

How to fix: Add a TestMakeRequest test class to tests/test_actions.py covering at least the happy path (successful GET) and one failure path (non-2xx response), following the fixture pattern used by other test classes in that file.

Copy link
Copy Markdown
Author

Issue: readme.html deleted with no manual_readme_content.md replacement readme.html is removed in this PR (127 deletions). manual_readme_content.md is absent from both base and head (404 at both SHAs). The deleted file contained OAuth setup instructions, PAT generation steps, auth priority order, and state file permissions — none of which appear in any other file in the PR.

Location: readme.html:1

Impact: SDK apps use manual_readme_content.md as the source for generated README docs. Without it, the published app will have no authentication setup instructions, breaking the user experience for OAuth and PAT configuration.

How to fix: Create manual_readme_content.md with the authentication, OAuth callback URL, PAT generation, auth priority, and state file permissions content from the deleted readme.html.

Copy link
Copy Markdown
Author

Issue: Versioned release note files release_notes/2.1.1.md and release_notes/2.1.2.md deleted The PR diff removes release_notes/2.1.1.md (content: dependency removal for PAPP-31087/31082/31096/30822) and release_notes/2.1.2.md (content: Python 3.13 support). No equivalent content appears in release_notes/unreleased.md or any other added file.

Location: release_notes/2.1.1.md:1

Code reference: release_notes/2.1.1.md, release_notes/2.1.2.md

Impact: Deleting versioned release note files removes permanent changelog entries for shipped releases, breaking traceability for users and reviewers checking what changed in those versions.

How to fix: Restore release_notes/2.1.1.md and release_notes/2.1.2.md with their original content. Only release_notes/unreleased.md should be modified for in-progress changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants